<template>
	<view>
		<view>
			<view class="flexwc" style="padding: 30rpx;">
				<view class="commLabel" v-for="(item,index) in orderLabels" :key="index" @click="goOrder(item.LabelID)">
					<view class="" style="flex: 1;display: flex;justify-content: center;align-items: center;">
						<image :src="item.Labelicon" style="width: 90rpx;height: 90rpx;"></image>
					</view>
					<view style="text-align: left;flex: 1;">
						{{item.LabelName}}
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				orderLabels: [],

			};
		},
		onLoad(options) {
			this.getLabels();
		},
		methods: {
			getLabels() {
				this.$httpost('/Labels/List', {
					'typeid': 4
				}).then(res => {
					// console.log(res)
					if (res.code == 200) {
						this.orderLabels = res.data.LabelList;
						this.orderLabels.forEach((item, index) => {
							this.imageList.forEach((j, k) => {
								if (index == k) item['imageIcon'] = j
							})
						})
					}
				})
			},
			goOrder(orderID) {
				uni.navigateTo({
					url: '/releasePages/pages/reservationOrder?oid=' + orderID
				})
			},
			goTab(url) {
				// console.log(url)
				uni.switchTab({
					url: url
				})
			}
		}
	}
</script>

<style lang="scss">
	.publicTitle {
		padding: 30rpx;
		font-size: 30rpx;
		font-weight: bold;
	}

	.commLabel {
		width: calc((100% - 40rpx) / 2);
		height: 80rpx;
		margin-right: 30rpx;
		margin-top: 25rpx;
		background-color: #FFF;
		border: 1rpx solid #FFF;
		border-radius: 10rpx;
		font-size: 30rpx;
		text-align: center;
		line-height: 80rpx;
		box-shadow: 0rpx 0rpx 5rpx 0rpx #e3e3e3;

		display: flex;
		justify-content: center;
		align-items: center;
		padding: 20rpx 0;

		&:nth-child(2n) {
			margin-right: 0;
		}

		&:nth-child(1) {
			margin-top: 0;
		}

		&:nth-child(2) {
			margin-top: 0;
		}
	}
</style>